Atomic writes, improved sentiment, dynamic calendar, 10Y yield#117
Open
mikejamescalvert wants to merge 2 commits intomainfrom
Open
Atomic writes, improved sentiment, dynamic calendar, 10Y yield#117mikejamescalvert wants to merge 2 commits intomainfrom
mikejamescalvert wants to merge 2 commits intomainfrom
Conversation
Infrastructure: - Add atomic_write() utility (temp file + os.replace) to prevent JSON corruption from concurrent agent writes or crashes - Apply atomic writes to all 3 persistence files: thesis store, equity tracker, and trade journal News sentiment: - Expand word lists from 7 to 27 words per polarity (covers verb forms, common financial terms like rally/plunge/layoffs) - Add negation handling: "not surge" now scores negative instead of positive. Tracks negation state across words. Macro data: - Replace hardcoded 2026 economic calendar with dynamic date calculation (first Friday = Jobs Report, ~12th = CPI). Works across years without manual updates. - Fetch 10-year Treasury yield from Yahoo Finance (^TNX). Was always None despite field existing in model. Critical for rate-sensitive trade decisions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final batch from the comprehensive QA audit. Addresses infrastructure, data quality, and forward-compatibility issues.
Atomic JSON Writes
atomic_write()utility inutils/io.py— writes to.tmpfile then usesos.replace()for atomic swapNews Sentiment Improvements
Dynamic Economic Calendar
10-Year Treasury Yield
Nonedespite field existing inMacroContextmodel^TNX) alongside VIX and SPYFiles Changed (6)
utils/io.pypersistence/thesis_store.pypersistence/equity_tracker.pyperformance/benchmarking.pydata/news.pydata/macro.pyTest plan
🤖 Generated with Claude Code